﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Monitor.Controllers.ApiControllers;
using Monitor.Controllers.ApiControllers.Administrator;
using Monitor.Models.Interfaces;
using Monitor.Models.Json;

namespace Monitor.Controllers
{
    public class AdministrationController : MainController
    {     

        [HttpGet]
        public ActionResult Classificator()
        {
            return View();
        }

        [HttpPost]
        public ActionResult Classificator(Int64 id)
        {
            ViewBag.Id = id;
            switch (Convert.ToInt32(Math.Truncate(id / 10000000000.0)))
            {
                case 1:
                    {
                        ClassifDealerModel model;
                        using (ServiseInfoController data=DependencyResolver.Current.GetService<ServiseInfoController>())
                        {
                            model = data.Get(id);
                        }
                        return PartialView("IndexPartial/Dealer",model);
                    }   
                case 2:
                    {
                        return PartialView("IndexPartial/Operation"); 
                    }
                case 3:
                    {
                        return PartialView("IndexPartial/Car");
                    }
                case 4:
                    {
                        return PartialView("IndexPartial/Bak");
                    }
                default:
                    {
                        return PartialView("IndexPartial/None");
                    }
            }
        }

        public ActionResult Users()
        {
            return View();
        }

       // [NonAction]
       // public PartialViewResult NewUser()
       // {
           // return PartialView();
       // }

        public ActionResult Baks()
        {
            return View();
        }

        public ActionResult Cars()
        {
            return View();
        }
    }
}
